<#if user?? && user.linkType?? && user.linkType == "zzh"> <!-- 子账号-->
<#include "sshdXqListTemplate.html">
<#else>
	您没有权限查看该功能
</#if>
<#macro xmtopic>
${matchProject.matName!} 
</#macro>
<#macro extendCss>
<style>
#xm_content {margin-top: 30px;background-color:#f1f7f5;}
.container11001 {background-color:#f1f7f5;}
#xm_content .leftNav {
	width:200px;
	height :660px;
	background-color:#ffffff;
	float:left;
}

#xm_content .rightNav {
    width: 100%;
    background-color: #fff;
    float: right;
}

.footer {
	margin-top:0px;
}
.rightNav .xmxz1-container .xmxz1_tabcss{
	display: none;
}
.rightNav .xmxz1-container .el-input__inner {
     background-color: #fff;
    background-image: none;
    border: 1px solid #d9d9d9;
    color: #1f2d3d;
    height: 35px;
    float: left;
    padding-left: 10px;
    width: 338px;
    font-size: 15px;
}
.rightNav .xmxz1-container table td {
    padding-top: 14px;
    width: 45px;
    height: 50px;
}
.rightNav .xmxz1-container table .text_t {
    padding-top: 0px;
}
.rightNav .xmxz1-container table td label {
    color: #000;
    font-size: 16px;
    text-align: center;
    padding-left: 45px;
}

.rightNav .xmxz1-container .xmxz1_tabcss table.gridtable {
	width: 94%;
    position: relative;
    left: 30px;
}

.rightNav .xmxz1-container .xmxz1_tabcss table.gridtable th {
    height: 35px;
    text-align: left;
    color: #000;
    padding-left: 10px;
}
.footNav {
	height: 20px;
    background-color: #f1f7f5;
    float: left;
    padding-top: 33px;
    padding-left: 45%;
}
#xmxzxx1 .teacher_grid {
	height: 215px;
}
#xmxzxx1 .team_grid {
	height: 315px;
}

#xmxzxx1 .teacher_grid .teacher_grid11{
	height: 100px;
    overflow-y: scroll;
    width: 94%;
    position: relative;
    left: 30px;
    overflow-x: hidden;
}
#xmxzxx1 .teacher_grid .teacher_grid11 .gridtable{
    width: 100.1%;
    left: 0px
}

#xmxzxx1 .team_grid .team_grid11{
	height: 100px;
    overflow-y: scroll;
    width: 94%;
    position: relative;
    left: 30px;
    overflow-x: hidden;
}
#xmxzxx1 .team_grid .team_grid11 table.gridtable{
    width: 100.1%;
    left: 0px
}
.rightNav .xmxz1-container .xmxz1_tabcss table.gridtable th {
    width: 35px;
}
.rightNav .xmxz1-container .xmxz1_tabcss .ziliaoClass{
    width: 250px;
    padding:10px;
    height: 0px;
}
</style>
</#macro>
<#macro contentListShow>
	  <div class="rightNav">
	    <form  class="xmxz1-container"  id="matchProArticle_form" action="matchManager.do?saveMatchProArticle" method="post" enctype="multipart/form-data">
	    <input name="id" type="hidden" value="${(matchProArticleItem.id)!}" />
	    <input name="matchProjectId" type="hidden" value="${(matchProject.id)!}" />
	    <input name="artType" type="hidden" value="${(matchProArticleItem.artType)!}" />
	    <input name="universityLevel" type="hidden" value="${(matchProArticleItem.universityLevel)!'bk'}" />
	    <input name="publishStatu" type="hidden" value="${(matchProArticleItem.publishStatu)!'2'}" />
	    <input name="submitPerson" type="hidden" value="${(matchProArticleItem.submitPerson)!}"/>
	    <input name="submitStatu" type="hidden" value="${(matchProArticleItem.submitStatu)!'wtj'}" />
	    <input name="processStatus" type="hidden" value="${(matchProArticleItem.processStatus)!}" />
	    <input name="proImgPath" type="hidden" value="${(matchProArticleItem.proImgPath)!}" />
	     <input name="proImgName" type="hidden" value="${(matchProArticleItem.proImgName)!}" />
	    <input name="companyName" type="hidden" value="${(user.extInfo['matchUser'].companyName)!}" />
	      <div name="xmxz1_tab" id="xmxzxx1" class="xmxz1_tabcss" style="display:block">
	           <table id="csxmtable" style="width: 100%; height: 200px; background-color: fff;">
				  <tr>
				    <td><label>项目名称:</labtd>
				    <td><input type="text" id="artNameId_c" name="artName" maxlength="300"  placeholder="项目名称" autocomplete="off" class="el-input__inner" value="${(matchProArticleItem.artName)!}" <#if matchProArticleItem.processStatus?? && matchProArticleItem.processStatus == "jrjs">readonly="readonly" </#if>/></td>
				  </tr>
				  <tr>
				    <td class="text_t"><label>项目图片:</label></td>
				    <td class="text_t">
				    <table id="xmImageFileContent">
				    <#if proImgPathShow??>
				    <tr> <td class='ziliaoClass'>${(proImgPathShow)!}</td>
				    <td class='ziliaoClass'><a onclick='delXmImageFileButton(this,true)'>删除</a></td></tr>
				    </#if>
				    </table>
				    <input type="button" class="el-button_zLHandleFile" id="xmImageFileButtonHander" onclick="$('#xmImageFileButton').click()" value="选择项目图片"/>
				   	<input type="file"  accept="image/*" name="imgFile" placeholder="项目图片" id="xmImageFileButton" autocomplete="off" class="el-button_zLHandleFile" style="display:none" />
				   	<label style="color:red"> *建议尺寸：宽320像素，高200像素</label>
				   	</td>
				  </tr>
				   <tr>
				    <td class="text_t"><label>团队名称:</label></td>
				    <td class="text_t"><input type="text" id="teamNameId_c"  name="teamName" maxlength="100" placeholder="团队名称" autocomplete="off" class="el-input__inner" value="${(matchProArticleItem.teamName)!}" <#if matchProArticleItem.processStatus?? && matchProArticleItem.processStatus == "jrjs">readonly="readonly" </#if>/></td>
				  </tr>
				  <tr>
				    <td class="text_t"><label>项目资料:</label></td>
				    <td class="text_t" id="xmzlfile">
				      <table id="zltableContent">
				      <#if matchProArticleResouceList??>
				      	<#list matchProArticleResouceList as resouce>
				      	<tr name="fileCountName"> 
				      		<td class='ziliaoClass'>${(resouce.name)!}</td>
				      		<td class='ziliaoClass' id='xmzlfile'> 
				      			<a onclick='downLoadFile(this,${(resouce.id)!},true)'>下载</a> 
				      			<#if !(matchProArticleItem.processStatus?? && matchProArticleItem.processStatus == "jrjs")>
				      				<a onclick="deleteFile(this,'${(resouce.name)!}',true,${(resouce.id)!})">删除</a> 
								</#if>
				      		</td>
				      	</tr>
				      	</#list>
				      </#if>
				      </table>
				      <#include "uploadFile.html">
				      <#assign tContent="<tr name='fileCountName'> <td class='ziliaoClass'>{{fileName}}</td> <td class='ziliaoClass' id='xmzlfile'><a onclick=\"deleteFile(this,'{{fileName}}',false,null)\">删除</a> </td> </tr>">
				      <@uploadButton '.rar, .zip, .rvt, .bqd, .bmc, .mqd' 70 'zLHandleFile' '选择资料文件' 'zltableContent' 'Z' tContent/>
				      <label style="color:red"> 文件尺寸 : 小于70M, 可用扩展名: 支持.rar ,.zip ,.rvt ,.bqd ,.bmc, .mqd</label>
				    </td>
				  </tr>
				</table>
				<table style="width: 100%; height: 22px; background-color: #fff;"></table>
				<table style="width: 100%; height: 5px; background-color: #f1f7f5;"></table>
				<#include "sshdXqTable.html">
				<div class="teacher_grid"> 
					<@createTable styleClass='xmxz1_tabcss' tabfields = ['姓名','性別','院系','职务','邮箱','联系电话','操作'] isCheckBox=false checkBoxName='' func=tableDataList funcButton=teacherButton/>
					<!--<div class="teacher_grid11"> 
					 <@createTable styleClass='xmxz1_tabcss' tabfields = [] isCheckBox=false checkBoxName='' func=tableDataList funcButton=nunFouction/>
				    </div>-->
				</div>
				<table style="width: 100%; height: 5px; background-color: #f1f7f5;"></table>
				<div class="team_grid"> 
					<@createTable styleClass='xmxz1_tabcss' tabfields = ['姓名','性別','年级','专业','身份证','联系电话','操作'] isCheckBox=false checkBoxName='' func=tableDataList2 funcButton=teamButton/>
					<!--<div class="team_grid11"> 
					 <@createTable styleClass='xmxz1_tabcss' tabfields = [] isCheckBox=false checkBoxName='' func=tableDataList2 funcButton=nunFouction/>
				    </div>-->
				</div>
	  	  </div>
	    </form>
	  	
	  </div>
	   		<div class="xm_button">
	          <button  type="button" class="el-button3" style="margin-right: 50%;margin-bottom: 20px;width: 80px;" onclick="saveSsXmInfo(this)"><span style="font-size: 16px;">确定</span></button>
             </div>
</#macro>
<#macro nunFouction>
</#macro>
<#macro teacherButton>
<style>
.rightNav .xmxz1-container .xmxz1_tabcss .xm_button{
    height: 58px;
}
.rightNav .xmxz1-container .xmxz1_tabcss .xm_button button{
    height: 35px;
    width: 80px;
    border-radius: 5px;
    margin-top: 10px;
}
.rightNav .xmxz1-container .xmxz1_tabcss .xm_button h{
    position: relative;
    top: 20px;
    left: 50px;
    color: #000;
    font-size: 16px;
} 
.rightNav .xmxz1-container .xmxz1_tabcss table.gridtable td {
    height: 30px;
    text-align: left;
    word-break: break-all;
    padding-left: 10px
}
</style>
<div class="xm_button">
    <label><h>带队老师</h></label>
	<button  type="button" class="el-button3" style="margin-right: 75px;" onclick="addDivShowWindow('content_Teacher','teach_form_1','add','',null)"><span style="font-size: 16px;"><img src="static/cms/www/default/img/sshd/add.png"/>添加</span></button>
</div>
</#macro>
<#macro teamButton>
<div class="xm_button">
    <label><h>团队成员</h></label>
	<button  type="button" class="el-button3" style="margin-right: 75px;" onclick="addDivShowWindow('content_student','men_form_1','add','',null)"><span style="font-size: 16px;"><img src="static/cms/www/default/img/sshd/add.png"/>添加</span></button>
</div>
</#macro>

<#macro tableDataList>
<tbody>
<#if teacherDataList??>
  <#list teacherDataList as data>
    <tr id=teacher_${data.id!}">  
        <td name="xmId" style="display:none"><input type="checkbox" value="${data.id!}"></input></td>
	    <td>${data.techName!}</td>
	    <td><@jmax.dc key="SEX" code="${data.techSex!}" /></td>
	    <td><@jmax.dc key="MATCH_COMPANY_INFO" code="${data.techDept!}" /></td> 
	    <td>${data.techJob!}</td>  
	    <td>${data.techEmail!}</td>  
	    <td>${data.techTel!}</td>  
	    <td>
		<a onclick="addDivShowWindow('content_Teacher','teach_form_1','edit',${data.id!},this)">[编辑]</a>
		<a onclick="delTeacherOrMember(${data.id!},this,'teacher')">[删除]</a>
		</td>  
	</tr>  
  </#list>
 </#if>
  </tbody> 
</#macro>
<#macro tableDataList2>
<tbody>
<#if teamDataList??>
	<#list teamDataList as data>
     <tr id=team_${data.id!}">  
        <td name="xmId" style="display:none"><input type="checkbox" value="${data.id!}"></input></td>
	    <td>${data.memName!}</td>
	    <td><@jmax.dc key="SEX" code="${data.memSex!}" /></td>
	    <td>${data.memGrade!}</td> 
	    <td>${data.memMajor!}</td> 
	    <td>${data.memId!}</td>  
	    <td>${data.memTel!}</td>  
	    <td>
		<a onclick="addDivShowWindow('content_student','men_form_1','edit',${data.id!},this)">[编辑]</a>
		<a onclick="delTeacherOrMember(${data.id!},this,'member')">[删除]</a>
		</td>  
	 </tr>  
  </#list>
 </#if>
  </tbody> 
</#macro>

<#macro buttonOprator>
	<#include "sshdCsXmAddEdit.html"> 
	<@saveXmEdit/>
	<style>
#contentMessage{
	border-radius: 3px;
    -moz-border-radius: 5px;
    background-clip: padding-box;
    width: 194px;
    background: #fff;
    border: 1px solid #eaeaea;
    position: absolute;
    top: 40%;
    left: 40%;
    z-index: 1000;
}
</style>
	
	<div id="contentMessage" style="display: none;">
		<img src="static/cms/www/default/img/sshd/load.gif">数据保存中，请等待...
	</div>
</#macro>
<#macro screenJs>
<script type="text/javascript" src="static/jmax/js/import.js"></script>
<script type="text/javascript" src="static/cms/www/default/js/jquery-confirm/jquery-confirm.js"></script>
<script type="text/javascript" src="static/plugins/jquery/jquery.form.js"></script>
<script type="text/javascript">
$('#xmImageFileButton').change(function() {
	var $this = $(this),
		files = this.files;
	if(files && files.length) {
		var html = "<tr> <td class='ziliaoClass'>"+files[0].name+"</td><td class='ziliaoClass'><a onclick='delXmImageFileButton(this,false)'>删除</a></td></tr>";
		$("#xmImageFileContent").html(html);
	}
});
function delXmImageFileButton(obj,isDelWhere){
if(isDelWhere) {
	$("#matchProArticle_form input[name='proImgPath']").val('');
} else 
{
	var file=document.getElementById('xmImageFileButton');
	var b = myBrowser();
            //IE，Safari，chrome
   if(file.outerHTML && (b == "IE")){
       file.outerHTML=file.outerHTML;
   }
  else{      //FF
    file.value="";
   }
}
            delTr(obj);
}
function myBrowser(){
    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
    var isOpera = userAgent.indexOf("Opera") > -1;
    if (isOpera) {
        return "Opera"
    }; //判断是否Opera浏览器
    if (userAgent.indexOf("Firefox") > -1) {
        return "FF";
    } //判断是否Firefox浏览器
    if (userAgent.indexOf("Chrome") > -1){
  return "Chrome";
 }
    if (userAgent.indexOf("Safari") > -1) {
        return "Safari";
    } //判断是否Safari浏览器
    if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
        return "IE";
    }; //判断是否IE浏览器
}

function addTableG(tableId,html) {
      var dom = "xmxzxx1 ."+tableId;
      var table =  $("#" + dom);
      var _len =  $("#" + dom +" tr").length;      
      $("#" + dom +" tbody").prepend(html);  
}

function downLoadFile(obj,id,isDown) {
	if(!isDown) {
		$.alert("未上传，不能下载！");
	} else {
	if($("iframe.downLoadFrame").length > 3)
	{
		$("iframe.downLoadFrame").remove();
	}
		$("iframe#downLoadFrame_"+id).remove();
		var iframe = document.createElement("iframe");
		iframe.id='downLoadFrame_'+id;
		iframe.className='downLoadFrame';
		iframe.src = "matchManager.do?downFile&id="+id;
		$(iframe).css("display","none");
		$("body").append(iframe);
		var state = 0;
		iframe.onload=iframe.onreadystatechange = function(){
			if(state == 0)
			{
				var html = iframe.contentWindow.document.body.innerHTML;
				var dd=html.replace(/<\/?.+?>/g,"");
 				var dds=dd.replace(/ /g,"")
				if(dds != "")
				{
					var msg = eval("("+dds+")");
					$.alert(msg.msg);
				}
			}
		};
	}
}
function deleteFile(obj,fileName,isDelete,id) {
	if(!isDelete) {
		delTr(obj);
		delFile(obj,fileName);
	} else {
	 $.confirm({
    	title: '提示',
    	content: '你确认刪除资料吗?',
    	confirm: function(){
		$.ajax({
		     type: 'POST',
		     url: "matchManager.do?deleteFile&matchProjectId=${(matchProject.id)!}",
		     dataType : 'json',  
		     data: {ids:id},
		     success: function(data) {
		         $.alert(data.msg);
		         if(data.success) {
		         	delTr(obj);
		         }
	         },
     	    error:function(data,textstatus){
     	    	errorMessage();
           }  
		});
       },
       cancel: function(){
      }
	});	
  }
}
function delTr(obj){
  obj.parentNode.parentNode.remove();
}
  
function delTeacherOrMember(id,obj,type) {
    if(type == null || type == "") {
    	$.alert("无效请求连接！");
    	return;
    }
    var tip = "带队老师";
    var doUrl = "delTeacher";
    if(type == "member") {
    	doUrl = "delMember";
    	tip = "团队成员";
    } else if (type != "teacher"){
    	$.alert("无效请求连接！");
    	return;
    }
	$.confirm({
    title: '提示',
    content: '你确认刪除'+tip+'吗?',
    confirm: function(){
		$.ajax({
		     type: 'POST',
		     url: "matchManager.do?"+doUrl+"&matchProjectId=${(matchProject.id)!}",
		     dataType : 'json',  
		     data: {ids:id},
		     success: function(data) {
		         $.alert(data.msg);
		         if(data.success) {
		         	delTr(obj);
		         }
	         },
     	    error:function(data,textstatus){
     	    	errorMessage();
           }  
		  });
    },
    cancel: function(){
    }
});
}
function saveSsXmInfo(obj) {
	if($("#artNameId_c").val() == "") {
		$.alert("项目名称不能为空");
		return;
	}
	if($("#teamNameId_c").val() == "") {
		$.alert("团队名称不能为空");
		return;
	}
	var el = $("tr[name='fileCountName']");
	if(el.length > 10) {
		$.alert("项目资料附件最多只能10个！");
		return;
	}
    obj.setAttribute("disabled","disabled");
    obj.style.backgroundColor = "#bfcbd9";
    obj.style.borderColor = "#bfcbd9";
	var fd = new FormData($('#matchProArticle_form')[0]);
	for(var i = 0, j = curFilesZ.length; i < j; ++i) {
		fd.append('files', curFilesZ[i]);
	}
	LayerShowWindow('contentMessage');
	$.ajax({
		url: 'matchManager.do?saveMatchProArticle',
		type: 'post',
		data: fd,
		//async: false,
		processData: false,
		contentType: false,
		success: function(data) {
		       LayerShowWindow('contentMessage');
               $.confirm({
				    title: '提示',
				    content: data.msg,
				    cancelButton : false,
				    confirm: function(){
				       if(data.success) {
		         	      window.location.href = "matchManager.do?sshdCsXm&sshdId=${matchProject.id!}";
		               } else {
		               		 obj.removeAttribute("disabled");
      					     obj.style.backgroundColor = "#1C6DC9";
      					     obj.style.borderColor = "#1C6DC9";
		               }
				    },
				    cancel: function(){
				    	obj.removeAttribute("disabled");
      					obj.style.backgroundColor = "#1C6DC9";
      					obj.style.borderColor = "#1C6DC9";
				    }
			});
		},
		error: function(err) {}
	});
}
</script>
</#macro>
